ff1e7cacfc9c68665eba00e17fd1431bfad13b8d,bundles/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/ThreadJob.java,ThreadJob,joinRun,#ThreadJob#IProgressMonitor#,187
Before Change
// just return if lock listener decided to grant immediate access
if (manager.getLockManager().aboutToWait(blocker))
return threadJob;
return waitForRun(threadJob, monitor, blockingJob, blocker);
} finally {
manager.getLockManager().aboutToRelease();
}
After Change
// just return if lock listener decided to grant immediate access
if (manager.getLockManager().aboutToWait(blocker))
return threadJob;
result = waitForRun(threadJob, monitor, blockingJob, blocker);
} finally {
// We need to check for interruption unconditionally in order to
// ensure we clear the thread's interrupted state. However, we only
// throw an OperationCanceledException outside of the finally block
// because we only want to throw that exception if we're not already
// throwing some other exception here.
interruptedDuringWaitForRun = Thread.interrupted();
manager.getLockManager().aboutToRelease();
// If the thread was interrupted prior to the call to joinRun, the
// interruption was not caused by the jobs framework. Although the
// correct behavior here is to still terminate cleanly and throw
// an OperationCanceledException, there are some existing unit tests
// that are interrupting threads and are relying on the fact that
// nobody reacts to the interruption. To keep these tests working,
// we restore the interrupted flag back to the state it had
if (setInterruptFlagAtEnd) {
Thread.currentThread().interrupt();
}
}
// During the call to waitForRun, we use the thread's interrupt flag to
// trigger cancellation, so thread interruption at this time should
// trigger an OCE.
if (interruptedDuringWaitForRun) {
throw new OperationCanceledException();
}
return result;
}
private static ThreadJob waitForRun(ThreadJob threadJob, IProgressMonitor monitor, InternalJob blockingJob,